import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';
import 'novel_detail_nav_state.dart';
part 'novel_detail_nav_event.dart';

class NovelDetailNavBloc extends Bloc<NovelDetailNavEvent, NovelDetailNavState> {
  NovelDetailNavBloc() : super(NovelDetailNavState()) {
    on<NovelDetailNavEvent>(_changeAppBarAlphaEvent);
  }

  /// 改变透明度
  void _changeAppBarAlphaEvent(event, emit) {
    var newStates = state.clone();
    newStates.appBarAlpha = event.appBarAlpha;
    newStates.offset = event.offset;
    emit(newStates);
  }
}
